package com.fun;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;

public class TestJaxb {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Book b=new Book();
		b.setId(12);
		b.setIsbn("jb");
		b.setName("jaxb");
		try {
			JAXBContext jaxbContext = JAXBContext.newInstance(Book.class);
			Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
			jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
			jaxbMarshaller.marshal(b, System.out);
		} catch (JAXBException e) {
			
			e.printStackTrace();
		}

	}

}
